package com.ruoyi.match.exception;

public class CustomException extends RuntimeException {
   
	private static final long serialVersionUID = 4522258539684069339L;
	//异常错误编码
    private int code ;
    //异常信息
    private String message;
    private CustomResponse resultJson;
    private CustomException(){}

    public CustomResponse getResultJson() {
        return resultJson;
    }

    public void setResultJson(CustomResponse resultJson) {
        this.resultJson = resultJson;
    }

    public CustomException(CustomExceptionType exceptionTypeEnum,
                           String message) {
        this.code = exceptionTypeEnum.getCode();
        this.message = message;
    }


    public CustomException(CustomResponse resultJson) {
        this.resultJson = resultJson;
    }
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return "CustomException{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", resultJson=" + resultJson +
                '}';
    }
}